<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="../../js/vue.js"></script>
    <style>
        [v-cloak] {
            display: none;
        }
    </style>
</head>

<body>

    <dvi id="app">
        <!-- v-bind指令用法 -->
        <a v-bind:href="url">点击</a>
        <!-- 缩写形式 -->
        <a :href="url">点击</a>
        <button @click="handle">切换连接</button>
    </dvi>

    <script>
        var vm = new Vue({
            el: "#app",
            data: {
                url: "http://www.baidu.com"
            },
            methods:{
                handle(){
                    this.url = "https://cn.vuejs.org/v2/api/#v-bind"
                }
            }
        })
    </script>
</body>

</html>